package com.ciei.dpagm.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

/**
 * @author pp
 * @date 2023/03/11
 */
public enum ConditionalRelationEnum {

    /**
     * 并且
     */
    AND(1, "并且"),
    /**
     * 或者
     */
    OR(2, "或者");

    @EnumValue
    private Integer id;
    /**
     * 名称
     */
    private String name;

    ConditionalRelationEnum(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public static ConditionalRelationEnum getEnumByValue(int value) {
        for (ConditionalRelationEnum factModeEnum : values()) {
            if (factModeEnum.getId() == value) {
                return factModeEnum;
            }
        }
        return null;
    }
}
